<script setup>
// 获取屏幕安全距离
const { safeAreaInsets } = uni.getSystemInfoSync()
</script>

<template>
  <view class="header" :style="{ paddingTop: safeAreaInsets.top + 'px' }">
    <view class="content">
      <!-- 头像 -->
      <navigator class="img" open-type="navigate" hover-class="navigator-hover">
        <image src="../../../static/uploads/茶百道.png" mode="scaleToFill" />
      </navigator>
      <!-- 用户信息 -->
      <view class="info">
        <view class="name">测试名称</view>
        <navigator class="txt" open-type="navigate" hover-class="navigator-hover">
          <text>更新头像昵称</text>
        </navigator>
      </view>
      <!-- 设置 -->
      <navigator class="setting" hover-class="none" url="/pagesMember/setting/setting">
        设置
      </navigator>
    </view>
  </view>
</template>

<style lang="less" scoped>
.header {
  position: relative;
  height: 250rpx;
  background-color: wheat;
  border-radius: 0 0 25% 25%;
  .content {
    margin-top: 20rpx;

    padding: 0 36rpx;
    display: flex;
    height: 120rpx;
    /* 头像 */
    .img {
      margin-right: 20rpx;
      width: 120rpx;
      height: 120rpx;

      image {
        width: 100%;
        height: 100%;
        border-radius: 50%;
      }
    }
    /* 用户信息 */
    .info {
      padding: 16rpx 0;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: flex-start;
      line-height: 30rpx;

      .name {
        max-width: 350rpx;
        margin-bottom: 16rpx;
        font-size: 30rpx;
        font-weight: 600;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .txt {
        font-size: 20rpx;
        text {
          padding: 3rpx 10rpx 1rpx;
          margin-right: 10rpx;
          color: rgba(99, 219, 129, 0.6);
          border: 1px solid rgba(99, 219, 129, 0.8);
          border-radius: 30rpx;
        }
      }
    }
    /* 设置 */
    .setting {
      position: absolute;
      bottom: 45rpx;
      right: 40rpx;
      font-size: 30rpx;
      color: #fff;
    }
  }
}
</style>
